package pers.adogs.novelboot.dto.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

/**
 * 用户登录 请求DTO
 *
 * @author adogs
 */
@Data
public class UserLoginReqDto {

    @Schema(description = "邮箱", required = true, example = "adogs@163.com")
    @NotBlank(message = "邮箱不能为空！")
    @Pattern(regexp =
            "^[A-Za-z0-9]+([-._][A-Za-z0-9]+)*@[A-Za-z0-9]+(-[A-Za-z0-9]+)*(\\.[A-Za-z]{2,6}|[A-Za-z]{2,4}\\.[A-Za-z]{2,3})$",
            message = "邮箱格式不正确！")
    private String username;

    @Schema(description = "密码", required = true, example = "123456")
    @NotBlank(message = "密码不能为空！")
    private String password;

}
